package handler

import (
	"dashenwo.com/dashenwo/micro_srv/user_srv/internal/service"
	"github.com/micro/go-micro/v2/server"
	"github.com/micro/go-micro/v2/util/log"

	pb "dashenwo.com/dashenwo/micro_srv/user_srv/genpb"
	"dashenwo.com/dashenwo/micro_srv/user_srv/registry"
)

func Apply(server server.Server, ctn *registry.Container) {
	handlers := NewUserHandler(ctn.Resolve("user_service").(*service.UserService))
	log.Log(handlers)
	if err := pb.RegisterUserHandler(server, handlers); err != nil {
		log.Fatal("暴露接口失败")
	}
}
